//
//  MXFindBlockTypeSixCollectionViewCell.m
//  MXの衣柜
//
//  Created by 马霄 on 15/8/15.
//  Copyright (c) 2015年 霄 马. All rights reserved.
//

#import "MXFindBlockTypeSixCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@interface MXFindBlockTypeSixCollectionViewCell ()
@property (nonatomic, retain) UIImageView *mainImageView;
@end
@implementation MXFindBlockTypeSixCollectionViewCell
- (void)dealloc
{
    [_modelS release];
    [_mainImageView release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.mainImageView = [[[UIImageView alloc ]init] autorelease];
        self.mainImageView.backgroundColor = [UIColor purpleColor];
        [self.contentView addSubview:self.mainImageView];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.mainImageView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
- (void)getInfo:(MXFindDetailModel *)model rowNum:(NSInteger) rowNum
{
    if (_modelS != model) {
        [_modelS release];
        _modelS = [model retain];
    }
    NSMutableArray *arr = [NSMutableArray array];
    for (NSDictionary *dict in model.product) {
        
        [arr addObject:[dict objectForKey:@"img"]];
        
    }
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:arr[rowNum]] placeholderImage:[UIImage imageNamed:@"plaseholder"]];
}
@end
